chore: civc tests refactor#16086
Conversation
In `stdlib_uint` we no longer need logical operations because the only places they were used in, i.e., std/turbo version of sha256, blake2s, blake3s, have been removed. So its best to reduce complexity of the `uint` class and keep it minimal. Removed the following functions from the `uint` class: ```cpp operator^ operator& operator| operator~ operator>> operator<< ror rol logic_operator ```
…ments as input and returns the commitment to the merged table (#15949) We modify the `MergeVerifier` so that it gets the subtable commitments as input and returns the commitment to the merged table. The reason for this change is that given the new structure of `ClientIVC` following [#15704](#15704), we can't access the merged table commitments from inside `complete_hiding_circuit_logic`. This PR is in preparation for [#15829](#15829) --------- Co-authored-by: AztecBot <tech@aztecprotocol.com>
The tar is not supposed to be checked in according to 50a1bd3#r2229436867
bec97b3 to
812decc
Compare
| @@ -207,27 +208,6 @@ TEST_F(ClientIVCTests, BadProofFailure) | |||
| EXPECT_TRUE(true); | |||
| }; | |||
There was a problem hiding this comment.
test above exists in the integration tests
There was a problem hiding this comment.
the test seems most suited for this module I feel though.
There was a problem hiding this comment.
Yeah that’s true - I think the two test files should just be merged into a single one. Could do it in this PR tbf
kashbrti
left a comment
There was a problem hiding this comment.
will check the rest later. but so far other than a couple clarifications it looks good.
| honk_vk->set_metadata(proving_key->get_metadata()); | ||
| vinfo("set honk vk metadata"); | ||
| } | ||
| honk_vk = precomputed_vk; |
There was a problem hiding this comment.
hmm, so we don't have any cases where the vk is not provided? was this exclusive to our mock vks?
There was a problem hiding this comment.
Well the cases where we were computing the vk on the fly or adding metadata to the the vk was purely for testing and benching purposes. We still mock vks for benchmarks but we do so completely in the test utilities.the accumulate function is meant to be used only with precomputed vks in productions and so I just made tests amenable to production behaviour
| @@ -207,27 +208,6 @@ TEST_F(ClientIVCTests, BadProofFailure) | |||
| EXPECT_TRUE(true); | |||
| }; | |||
There was a problem hiding this comment.
the test seems most suited for this module I feel though.
| for (size_t idx = 0; idx < NUM_CIRCUITS; ++idx) { | ||
| auto circuit = circuit_producer.create_next_circuit(ivc); | ||
| ivc.accumulate(circuit, precomputed_vks[idx]); | ||
| auto [circuit, vk] = circuit_producer.create_next_circuit_and_vk(ivc, { .log2_num_gates = 5 + idx }); |
There was a problem hiding this comment.
seems like we were adding 2 to log2_num_gates per index but now we're adding one. Am I missing something here?
There was a problem hiding this comment.
It doesn’t matter, the point of the test was to keep increasing the number of gates in the circuit, and that way it could be made cleaner
| for (size_t j = 0; j < num_circuits; ++j) { | ||
| auto circuit = circuit_producer.create_next_circuit(ivc, log2_num_gates); | ||
| ivc.accumulate(circuit); | ||
| auto [circuit, vk] = circuit_producer.create_next_circuit_and_vk(ivc, { .log2_num_gates = 5 }); |
There was a problem hiding this comment.
feel like this value 5 is being used for a lot of tests, should we make it a global?
There was a problem hiding this comment.
Hm, it’s just an arbitrary value, would not want the civc tests to wrongly convey that some circuits should be set to log size 5
There was a problem hiding this comment.
We can still have a global called EXAMPLE_LOG_NUM_GATES still I guess.
| for (auto& commitment : key->get_all()) { | ||
| commitment = MegaFlavor::Commitment::random_element(); | ||
| } | ||
| auto key = idx % 2 == 0 ? app_vk : kernel_vk; // alternate between app and kernel vks |
There was a problem hiding this comment.
hmm, not sure I saw where we are populating the commitments in the refactored code.
There was a problem hiding this comment.
so i'm creating one app vk and one kernel vk above and just using those - the point of these mock vks is to speeed up benchmarks (in the sense that these vks will obviously be wrong but instead of spending time precomputing the vks of many circuits we just do two using our mock circuits so civc will not crash running with them)
kashbrti
left a comment
There was a problem hiding this comment.
other than some comments lgtm.
…m/civc-mock-tests-refactor
…m/civc-mock-tests-refactor
This reverts commit 59bc177.
See [merge-train-readme.md](https://github.com/AztecProtocol/aztec-packages/blob/next/.github/workflows/merge-train-readme.md). BEGIN_COMMIT_OVERRIDE chore: civc tests refactor (#16086) chore: save memory in trace blocks when gate selectors are known to be all zero (#16044) chore: Revert "chore: civc tests refactor" (#16133) fix: revert "chore: save memory in trace blocks when gate selectors are kn… (#16139) feat: specialised ZeroSelector to save memory on selectors known to be zero (#16141) chore: add a `PG_TAIL` proof and queue type (#15986) Revert "chore: add a `PG_TAIL` proof and queue type" (#16152) END_COMMIT_OVERRIDE --------- Co-authored-by: AztecBot <tech@aztecprotocol.com> Co-authored-by: maramihali <mara@aztecprotocol.com> Co-authored-by: Jonathan Hao <jonathan@aztec-labs.com> Co-authored-by: Suyash Bagad <suyash@aztecprotocol.com> Co-authored-by: federicobarbacovi <171914500+federicobarbacovi@users.noreply.github.com> Co-authored-by: Khashayar Barooti <khashayar@aztecprotocol.com> Co-authored-by: Lucas Xia <lucasxia01@gmail.com>
In this PR (redo of #16086): * unify the logic of the two mock circuit producers for CIVC tests * remove logic in CIVC to handle whether we are or are not receiving precomputed vks and mocked vks, accumulate now * expects a precomputed verification key * remove redundant tests * make our Typescript integration tests also provide precomputed vks for both the native and wasm version of CIVC
In this PR:
accumulatenow expects a precomputed verification key